{include file="public/layout" /}

<body class="bodystyle" style="overflow-y: scroll;">
<div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
    <div class="fixed-bar">
        <div class="item-title"><a class="back" href="{:url('Member/users_index')}" title="返回列表"><i class="fa fa-angle-double-left"></i>返回</a></a>
            <div class="subject">
                <h3>会员中心 - 新增会员</h3>
                <h5></h5>
            </div>
        </div>
    </div>
    <form class="form-horizontal" id="postForm" action="{:url('Member/users_add')}" method="post">
        <div class="ncap-form-default">
            <dl class="row"><dt class="tit"><label><b>基本资料</b></label></dt></dl>
            <dl class="row">
                <dt class="tit">
                    <label for="username"><em>*</em>用户名</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="username" id="username" class="input-txt">
                    <p class="notic"></p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="password"><em>*</em>登录密码</label>
                </dt>
                <dd class="opt">
                    <input type="password" name="password" id="password" class="input-txt">
                    <p class="notic"></p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="password2"><em>*</em>确认密码</label>
                </dt>
                <dd class="opt">
                    <input type="password" name="password2" id="password2" class="input-txt">
                    <p class="notic"></p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="level">会员级别</label>
                </dt>
                <dd class="opt">
                    <select name="level" id="level">
                        {volist name='$user_level' id='vo'}
                            <option value="{$vo.level_id}" >{$vo.level_name}</option>
                        {/volist}
                    </select>
                    <span class="err"></span>
                    <p class="notic"></p>
                </dd>
            </dl>
            {notempty name='$users_para'}
            <dl class="row"><dt class="tit"><label><b>更多资料</b></label></dt></dl>
            <!-- 会员属性 开始 -->
            {include file="member/users_field"/}
            <!-- 会员属性 结束 -->
            {/notempty}
            <div class="bot">
                <a href="JavaScript:void(0);" onclick="checkForm();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a>
            </div>
        </div>
    </form>
</div>

<script type="text/javascript">
    function checkForm(){
        if($('input[name=username]').val() == ''){
            showErrorMsg('用户名不能为空！');
            $('input[name=username]').focus();
            return false;
        }

        var password = $('#password').val();
        var password2 = $('#password2').val();
        if(password == ''){
            showErrorMsg('登录密码不能为空！');
            $('#password').focus();
            return false;
        }
        if(password2 == ''){
            showErrorMsg('确认密码不能为空！');
            $('#password2').focus();
            return false;
        }
        if (password != '' || password2 != '') {
            if (password != password2) {
                showErrorMsg('两次密码输入不一致！');
                $('input[name=password]').focus();
                return false;
            }
        }

        layer_loading('正在处理');
        $('#postForm').submit();
    }
</script>

{include file="public/footer" /}